<script setup>
import { ref } from 'vue';
import sonCom from './components/son-com.vue'

const message = ref('他就是个儿子')
const changeSon = () => {
  message.value = '她是个姑娘(不是生儿育女)'
}
const getMessage = (msg) => {
  console.log(msg);
  message.value = msg
}

</script>

<template>
  <div class="app-page">
    app
    <button @click="changeSon">换个儿子</button>
    <!-- 监听自定义事件 -->
    <sonCom :message="message" @get-message="getMessage"></sonCom>
  </div>
</template>

<style scoped></style>
